var gulp = require('gulp')
var uglify = require('gulp-uglify')
var babel = require('gulp-babel')
var rename = require('gulp-rename')
var concat = require('gulp-concat');
// 压缩 js 文件
// 在命令行使用 gulp script 启动此任务
gulp.task('uglify', function () {
    return gulp.src('./src/*.js')
        .pipe(babel())
        .pipe(uglify())
        .pipe(rename({suffix: '.min'}))
        .pipe(gulp.dest('./dist'));
});
gulp.task('build', function () {
    return gulp.src('./src/*.js')
        .pipe(babel())
        .pipe(concat('index.js'))
        .pipe(uglify())
        .pipe(gulp.dest('./build'));
});